<template>
	<view class="paypage">
		<delivery-layout></delivery-layout>
		<view class="goodsList">
			<goods-list></goods-list>
		</view>
		
		<!-- #ifndef MP-WEIXIN -->
		<view class="payType">
			<view class="box" :class="item.value==payDefValue?'active':''" v-for="(item,i) in payType" :key="i" @click="clickPayBtn(item.value)">
				<u-icon :name="item.icon" class="icon" size="26" :color="item.color"></u-icon>
				<text class="font">{{item.name}}</text>
			</view> 
		</view>
		<!-- #endif -->
		
		
		<view class="payTabBar">
			<cart-layout type="pay"></cart-layout>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// #ifdef APP || H5
				payDefValue:"alipay",
				// #endif
				
				// #ifdef MP-WEIXIN
					payDefValue:"wxpay",
				// #endif
				
				payType:[
					{
						"name":"支付宝",
						"value":"alipay",
						"icon":"zhifubao",
						"color":"#1578ff"
					},
					{
						"name":"微信",
						"value":"wxpay",
						"icon":"weixin-fill",
						"color":"#04C15F"
					}
					]
			};
		},
		methods:{
			clickPayBtn(value){
				this.payDefValue=value;
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background: $page-bg-color;
	}
	.paypage{
		padding: 30rpx;
		
		.goodsList{
			margin-top: 30rpx;
		}
		.payType{
			@include flex-box();
			flex-wrap: wrap;
			.box{
				width: 49%;
				height: 75rpx;
				background: #fff;
				border-radius: 10rpx;
				margin-bottom: 20rpx;
				@include flex-box-set();
				border: 1px solid #fff;
				filter: grayscale(100%);
				.font{
					padding-left: 10rpx;
				}
			}
			
			.box:first-child.active{
				border-color: #1578ff;
				color: #1578ff;
				filter: grayscale(0%);
			}
			
			.box:last-child.active{
				border-color: #04C15F;
				color: #04C15F;
				filter: grayscale(0%);
			}
		}
		.payTabBar{
			position: fixed;
			width: 100%;
			bottom: 0;
			left: 0;
		}
	}
</style>
